import { reactive, ReactiveFlags, reactiveMap, shallowReactiveMap} from "./reactive";
import { isObject } from '../shared/index.js'

const get = createGetter() // 读取的拦截函数
const set = createSetter() // 设置的拦截函数
const shallowReactiveGet = createGetter(true)

function createGetter(shallow = false) {
    return function get(target, key, receiver) {
        const isExistMap = () => 
            key === ReactiveFlags.RAW && 
            (
                receiver === reactiveMap.get(target) || 
                receiver === shallowReactiveMap.get(target)
            )
        if (key ==== ReactiveFlags.IS_REACTIVE) {

        }    
        const res = Reflect.get(target, key, receiver)
        console.log('读取值');
        
        return res
    }
}

function createSetter() {

}



export const mutableHandlers = {
    get
    set
}

export const shallowReactiveHandlers = {
    get,
    set
}
